﻿package com.app.miwawa.api.system.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.framework.common.api.entity.CommonEntityUUID;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 广告管理
 * @author yupeng(余鹏)
 * @date:2016:6:7 15:37:15
 *
 */
@Entity(name="systemBanner") @Table(name="TB_SYSTEM_BANNER")
public class Banner extends CommonEntityUUID {

	private static final long serialVersionUID = -7742695370384596605L;

	//图片地址
	@Lob @Basic(fetch=FetchType.LAZY)
	@Column(name="url", nullable=true)
	private String url;
	
	//广告链接
	@Lob @Basic(fetch=FetchType.LAZY)
	@Column(name="link", nullable=true)
	private String link;
	
	//发布人id
	@Column(name="user_id" , length=50 , nullable=true)
	private String userid;
	
	//发布人姓名
	@Column(name = "user_name", length = 50, nullable = true)
	private String username;
	
	//投放机构
	@Column(name="organ" , length=50 , nullable=true)
	private String organ;
	
	//投放金额
	@Column(name="price" , length=50 , nullable=true)
	private Float price;
	
	//发布时间
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@Column(name = "create_date", nullable = false)
	private Date createDate;
	
	//起始时间
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "from_date", nullable = false)
	private Date fromDate;
	
	//终止时间
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "over_date", nullable = false)
	private Date overDate;
	
	public Banner(){
		
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getOrgan() {
		return organ;
	}

	public void setOrgan(String organ) {
		this.organ = organ;
	}

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getFromDate() {
		return fromDate;
	}

	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}

	public Date getOverDate() {
		return overDate;
	}

	public void setOverDate(Date overDate) {
		this.overDate = overDate;
	}
	
}
